/**
* Copyright (C) 2009 IcyRiver / Wesley He
*
* IcyRiver Lib may be copied only under the terms of the GNU General
* Public License V1, which may be found in the IcyRiver.net source kit.
* Please visit the IcyRiver Home Page http://icyriver.net/ for more detail.
**/

//socket.h

#ifndef _SOCKET_H_
#define _SOCKET_H_

#define __DEBUG__   1

#ifdef __cplusplus
extern "C" {
#endif

int g_socket_tcp_recv_data_select(int sock, void *data, \
		const int size, const int timeout, \
		int *count);

int g_socket_tcp_gets(int sock, char* s, \
		const int size, const int timeout);

int g_socket_accept_select(int sock, const int timeout, \
		int *err_no);

int g_socket_socket_server(const char *bind_ipaddr, const int port,\
		int *err_no);

int g_socket_connect_server_by_ip(int sock, char* ip, \
		short port, int *err_no);

int g_socket_connect_server(char* ip, short port, \
		int *err_no );

#ifdef __cplusplus
}
#endif

#endif

